<?php include('templates/header.php');
$CLASS_QUERIES = new Queries($mysqli);

//Page VARS
$table = 'products_keys';
$fields = array("id_$table", "product_key", "used", "products");
$fk = array("products" => "product"); //If the page has no fk null.

$show_actions = 1;
$show_delete = 1;
$show_edit = 0;

if (isset($_GET['id'])) {
    $id = $_GET['id'];
}

if (isset($_POST['insert'])) {

    $query = $CLASS_QUERIES->generate_insert($_POST, $table);
} elseif (isset($_GET['action']) and $_GET['action'] == 'del') {

    $CLASS_QUERIES->delete_item($id, $table);
}
?>

<?
include('list.php');
include('generic.insert.php');
?>

<? include('templates/footer.php'); ?>